package com.hxhy.log;

import java.io.PrintWriter;
import java.io.StringWriter;

import org.slf4j.LoggerFactory;

public class Logger {

	private static Logger logger;
	private static org.slf4j.Logger log=LoggerFactory.getLogger(Logger.class);
	
	public void info(String value) {
		log.info(value);
	}

	public String getStackTrace(Throwable throwable) {
		StringWriter stringWriter = new StringWriter();
		PrintWriter printWriter = new PrintWriter(stringWriter);
		try {
			throwable.printStackTrace(printWriter);
			return stringWriter.toString();
		} finally {
			printWriter.close();
		}
	}
	
	public static Logger getLogger(){
		if(logger == null){
			synchronized (Logger.class) {
				if(logger == null){
					logger = new Logger();
				}
			}
		}
		return logger;
	}
	
	private Logger(){
	}
}
